#include "bullet1.h"

bullet1::bullet1() {
    m_Bullet1.load(BULLET1_PATH);
    m_X=m_Bullet1.width()*0.5;
    m_Y=(GAME_HEIGHT-m_Bullet1.height())*0.5;
    m_Free=true;
    m_Speed=BULLET1_SPEED;
    m_Rect.setWidth(m_Bullet1.width());
    m_Rect.setHeight(m_Bullet1.height());
    m_Rect.moveTo(m_X,m_Y);
    m_injury=1;
}

void bullet1::updatePosition()
{
    if(m_Free)
    {
        return;
    }

    m_X+=m_Speed;
    m_Rect.moveTo(m_X,m_Y);

    if(m_X>=GAME_WIDTH){
        m_Free=true;
    }

}
